﻿<?php
include_once("../initial.php");
include_once("../dbdriver/adminWHandle.php");
include_once("../dbdriver/adminRHandle.php");
class adminLogic
{
    public function insert_admin($array)
    {
        if(is_array($array)==false)
        {
            return false;
        }
        if(count($array)==0)
        {
            return false;
        }
        $whandle = new adminWHandle();
        return $whandle->insert_data($array);
    }
    public function get_admin($array='', $orderby='', $limit='')
    {
        $rhandle = new adminRHandle();
        if($array == '')
        {
            return $rhandle->get_all_data($orderby,$limit);
        }
        else
        {
            return $rhandle->get_some_data($array, $orderby, $limit);
        }
    }
    public function get_admin_num($array='')
    {
        $rhandle = new adminRHandle();
        return $rhandle->get_admin_num($array);
    }
    public function update_admin($array,$id)
    {
        $handle = new adminWHandle();
        return $handle->update_admin($array,$id);
    }
    public function delete_admin($id)
    {
        $handle = new adminWHandle();
        return $handle->delete_admin($id);
    }
}
?>
